$(function (){
    //jq start
    authorities = $.session.get('authorities');
    append()
function append (){
    $.ajax({
        url:baseURL +"/auth/api/webUser/getWebUserList",
        data:{

        },
        type:'post',
        headers: {'authorities': authorities},
        success:function (e){
            for(let i=0;i<e.total;i++){
                c = e.data[i]
                $("#data-list").append(
                    '<tr><td class="sn">'+c.nickName+'</td><td class="title">'+c.name+'</td> <td class="grade">'
                    +c.account+'</td><td class="">'+c.wxOpenidParent+'</td><td class="">'+c.wxOpenidChild+'</td> <td class="">'+c.idnumber+'</td>'
                    +'<td class="">'+c.birthday+'</td><td class="">'+c.rxnd+'</td> <td class="">'+c.school+'</td>'
                    +'<td class="">'+c.classes+'</td><td class="">'+c.level+'</td>'
                    +'<td><a data-toggle="modal" class="modify-modal" href="#modify">修改 </a><a class="del"> 删除</a></td></tr>'

                )
            }

        }
    })
}
    $("#data-list").on("click",".show-modal",function (){
        $("#title_show").text($(this).parents('td').siblings(".name").text())
        $("#title_sed_show").text($(this).parents('td').siblings(".account").text())
        $("#title_thd_show").text($(this).parents('td').siblings(".account").text())
        $("#school_show").text($(this).parents('td').siblings(".school").text())
        $("#birthday_show").text($(this).parents('td').siblings(".birthday").text())
        $("#class_show").text($(this).parents('td').siblings(".class").text())
        $("#level_show").text($(this).parents('td').siblings(".level").text())
    })
    $("#data-list").on("click",".modify-modal",function () {
        $("#title_modal").text($(this).parents('td').siblings(".name").text())
        $("#title_sed_modal").text($(this).parents('td').siblings(".account").text())
        $("#title_thd_modal").text($(this).parents('td').siblings(".account").text())
        $("#school_modal").text($(this).parents('td').siblings(".school").text())
        $("#birthday_modal").text($(this).parents('td').siblings(".birthday").text())
        $("#class_modal").text($(this).parents('td').siblings(".class").text())
        $("#level_modal").text($(this).parents('td').siblings(".level").text())
    })
})
